<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Device
 *
 * @property int $id 设备ID
 * @property int $user_id 用户ID
 * @property int|null $total 总算力
 * @property int|null $use 已用算力
 * @property float $price 每T算力价格（USDT）
 * @property float $cost 租赁算力花费金额（USDT）
 * @property string $finish_at 到期时间，3年有效期
 * @property int $status 矿机状态 0-已过期  1-进行中
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereCost($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereFinishAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device wherePrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereTotal($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereUse($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Device whereUserId($value)
 * @mixin \Eloquent
 */
class Device extends Model
{
    protected $table = 'devices';

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
